APP_VERSION:=beta
PROJECT:=wuzhao-api
IMAGE_NAME:=registry.cn-hangzhou.aliyuncs.com/helloworldyu/${PROJECT}:${APP_VERSION}

.PHONY: docker-build
docker-build:
	docker build -t ${IMAGE_NAME} .
	docker push ${IMAGE_NAME}

.PHONY: docker-build-local
docker-build-local:
	docker build -t ${IMAGE_NAME} .

.PHONY: docker-push
docker-push:
	docker login --username=457288021@qq.com registry.cn-hangzhou.aliyuncs.com --password=qazwsx@docker
	docker build -t ${IMAGE_NAME} .
	docker push ${IMAGE_NAME}

.PHONY: docker-run
docker-run:
	docker run -d -p 8085:8085 --name ${PROJECT}-${APP_VERSION} ${IMAGE_NAME}

.PHONY: docker-stop
docker-stop:
	docker stop ${PROJECT}-${APP_VERSION}
	docker rm ${PROJECT}-${APP_VERSION}

.PHONY: dev
dev:
	npm run dev

.PHONY: build
build:
	npm run build

.PHONY: start
start:
	npm start

.PHONY: install
install:
	npm install 